<div class="leftcontent">
    <div class="menuLeft">
        <ul>

            <?php
            if ($menuProductCate) {
                $count_menu = count($menuProductCate);
                foreach ($menuProductCate as $key => $menu_item) {
                    ?>  
                    <li<?php if ($key == ($count_menu - 1)) echo ' class="last"' ?>><a href="<?php echo urlAlias($menu_item->name_alias) ?>" title="<?php echo $menu_item->name; ?>"><img src="<?php echo base_url() ?>templates/images/icon-<?php echo $key + 2 ?>.jpg" alt="<?php echo $menu_item->name; ?>" /><span><?php echo $menu_item->name; ?></span></a>
                        <?php $sub_menu_cate = getMenuProCate($menu_item->product_category_id); ?>
                            <?php if ($sub_menu_cate) { ?>
                            <ul>
            <?php foreach ($sub_menu_cate as $sub_item) { ?>
                                    <li><a href="<?php echo urlAlias($sub_item->name_alias) ?>" title="<?php echo $sub_item->name; ?>"><?php echo $sub_item->name; ?></a>

                <?php $sub1_menu_cate = getMenuProCate($sub_item->product_category_id); ?>

                                    </li>

            <?php } ?>
                                <div class="bg_img">
                                    <img src="<?php echo base_url() ?>templates/images/<?php echo $menu_item->name_alias ?>.jpg" title="<?php echo $menu_item->name; ?>">
                                </div>
                            </ul>
        <?php } ?>
                    </li>


                <?php
                }
            }
            ?>
        </ul>
    </div>
</div><!--leftcontent-->
